package utils;

import java.io.*;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

import utils.ThumbNailer.ThumbNailable;

public class Picture implements ThumbNailable {
	private int nID;
	private String strName;
	private String strLocation;
	private String strPosition;
	private String strPath;
	private Date date;
	
	private String thumbNailPath;
	
	public Picture ( int nID,
			String strName,
			String strLocation,
			String strPosition,
			String strPath,
			Date date ) {
		
		this.nID = nID;
		this.strName = strName;
		this.strLocation = strLocation;
		this.strPosition = strPosition;
		this.strPath = strPath;
		this.date = date;
	}
	
	public int GetID() {
		return this.nID;
	}
	
	public String GetName() {
		return this.strName;
	}
	
	public String GetLocation() {
		return this.strLocation;
	}
	
	public String GetPosition() {
		return this.strPosition;
	}
	
	public String GetPath() {
		return this.strPath;
	}
	
	public Date GetDate() {
		return this.date;
	}
	
	public String getLocation() {
		return this.strLocation;
	}
	
	public String getPosition() {
		return this.strPosition;
	}
	
	public String getPath() {
		return this.strPath;
	}
	
	public Date getDate() {
		return this.date;
	}
	
	public String getDateForDisyplay() {
		DateFormat df = new SimpleDateFormat("dd.MM.yyyy HH:mm:ss");
		
		return df.format(getDate());
	}

	@Override
	public String getThumbNailPath() {
		String retval = getPath();
		
		retval = retval.substring(0, retval.length() - 4);
		
		return retval + ThumbNailer.thumbNailSuffix;
	}
}